﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SpotsHub.RouteService.Data
{
    public class EntityBase : Nop.Core.BaseEntity
    {
        //public int Id { get; set; }

        public const int DefaultStringLength = 50;

        //public override bool Equals(object obj)
        //{
        //    if (obj.GetType() != this.GetType())
        //    {
        //        return false;
        //    }
        //    if (this.Id != 0 && ((EntityBase)obj).Id == this.Id)
        //    {
        //        return true;
        //    }
        //    return base.Equals(obj);
        //}

        //public override int GetHashCode()
        //{
        //    return base.GetHashCode();
        //}
    }

    public class EntityWithNameBase : EntityBase
    {
        [MaxLength(EntityBase.DefaultStringLength)]
        public string Name { get; set; }

        public override string ToString()
        {
            return Name;
        }
    }
}
